package com.asset.bill.enums;

/**
 * 交易类型
 */
public enum EnumTransactionType {

    VEGETABLES(0,"蔬菜"),
    MEAT(1,"肉"),
    BREAKFAST(2,"早餐"),
    LUNCH(3,"午餐"),
    DINNER(4,"晚餐"),
    SUBWAY(5,"地铁"),
    CIGARETTE(6,"香烟"),
    TAXI(7,"出租"),
    CONDIMENT(8,"调料"),
    FRUIT(9,"水果"),
    CLOTHES(10,"衣服"),
    SHOES(11,"鞋子"),
    ARTICLES_FOR_DAILY_USE(12,"生活用品"),
    RED_ENVELOPES(13,"红包"),
    DRINK(14,"饮料"),
    PHONE(15,"话费"),
    APP(16,"APP充值"),
    SALARY(17,"工资"),
    BONUS(18,"奖金"),
    RENT(20,"房租"),
    LOAN(99,"借款"),
    OTHER(100,"其他"),
    ;

    private Integer code;

    private String message;

    EnumTransactionType(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public static EnumTransactionType getEnum(Integer code) {
        if (code == null) {
            return null;
        }
        for (EnumTransactionType value : EnumTransactionType.values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

}
